package ent.parent.com.parent;


import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;

import com.pp.ent.base.BaseFragment;
import com.pp.ent.view.annotation.ContentView;
import com.pp.ent.view.annotation.OnClick;
import com.pp.ent.view.annotation.ViewInject;

/**
 * Author:dengqu
 * Date:2016/7/27
 */
@ContentView(R.layout.fragment_main)
public class MainFragment extends BaseFragment {

    private View view;
    @ViewInject(R.id.tex_view)
    private TextView textView;

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        view = super.onCreateView(inflater, container, savedInstanceState);
        textView.setText("hello,I am fragment");
        return view;
    }


    @OnClick({R.id.tex_view})
    private void onClick(View view) {
        switch (view.getId()) {
            case R.id.tex_view:
                Toast.makeText(getActivity(), "click", Toast.LENGTH_SHORT).show();
                break;
        }
    }
}
